<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>信息查看</title>
	<meta name="decorator" content="default"/>
	<link href="${ctxStatic}/file/css/fileinput.css"  rel="stylesheet" type="text/css" />  
	<script src="${ctxStatic}/file/js/fileinput.min.js" type="text/javascript"></script>  
	 <script src="${ctxStatic}/file/js/fileinput_locale_zh.js" type="text/javascript"></script> 
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		function chong(){
			var b=$("#did").val();//获取当前用户重新赋值
		    $(':input,#inputForm')  
	         .not(':button, :submit, :reset, :hidden')  
	         .val('')  
	         .removeAttr('checked')  
	         .removeAttr('selected');   
		    $("#did").val(b);
		}

		
		
		function shang(){
			$('#demoModal').modal('show');
		}
		
		function shangchuan(){
			var form = new FormData(document.getElementById("userfile"));
			 form.append("file", form); 
		    $.ajax({  
		         url : "${ctx}/numberinfo/yhcgNumberinfo/file",  
		         type : "POST",  
		         data : form,
		         contentType: false,
		         processData: false,
		         success : function(data) {  
		        	$("#filename").val(data.name);
		        	$("#fileurl").val(data.url);
		        	document.getElementById("sfid").innerHTML=data.name;
		             alert("上传成功");
		         },  
		         error : function(data) {  
		             alert("上传失败");
		         }  
		    });  
		}
		$(function (){
			var id=$("#id").val();//获取当前工单id
			 $.ajax({  //获取延期处理信息
		         url : "${ctx}/delay/yhcgDelay/listcha",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a='';
		        	 if(data.length>0){
		        			$("#yan1").show();
		        			$("#yan2").show();
		        	  a="<table><tr><td>编号</td><td>申请人</td><td style='width: 100px'>申请原因</td><td>申请日期</td><td>延期天数</td><td>审核状态</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+(i+1)+"</td><td>"+data[i].name+"</td><td style=''>"+data[i].reasonsfodelay+""
		        		 +"</td><td>"+data[i].yantime+"</td>"
		        		 +"<td>"+data[i].extensiondays+"</td>"
		        		 var s=null;
		        		 if(data[i].status=="0"){
		        			 s="待审核";
		        		 }else if(data[i].status=="1"){
		        			 s="审核通过";
		        		 }else if(data[i].status=="2"){
		        			 s="审核拒绝";
		        		 }
		        		 a +="<td>"+s+"</td></tr>";
		        	 }
		        	  a +="</table>"
		         }else{
		        	 a +="暂无审核信息";
		         } 
		        	 document.getElementById("yan").innerHTML = a; 
		         }
		    });  
			
			 $.ajax({  //获取处理信息
		         url : "${ctx}/handleinfo/yhcgHandleinfo/listchu",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {  
		        	 var a='';
		        	 if(data.length>0){
		        		$("#chu1").show();
		     			$("#chu2").show();
		        	 a="<table><tr><td>编号</td><td>处理人</td><td>处理详情</td><td>处理日期</td><td>附件</td></tr>"
		        	 for(var i=0;i<data.length;i++){//支持以下几种图片展示BMP、JPG、JPEG、PNG、GIF
		        		 a +="<tr><td>"+(i+1)+"</td><td>"+data[i].processingtunit+"</td><td>"+data[i].processingtremark+""
		        		 a +="</td><td>"+data[i].processingtime+"</td>"
		        		 if(typeof(value)!="undefined"){
		        		 if((data[i].filechuname).indexOf("bmp")>-1||(data[i].filechuname).indexOf("jpg")>-1
		        				 ||(data[i].filechuname).indexOf("jpec")>-1||(data[i].filechuname).indexOf("png")>-1
		        				 ||(data[i].filechuname).indexOf("gif")>-1){
		        		 a += "<td><a onclick=jq('"+data[i].id+"')><img style='width: 50px;height: 50px'src='${ctx}/numberinfo/yhcgNumberinfo/uploadhuixian?url="+data[i].id+"'/></a></td>"
		        		 }else{
		        			 a += "<td><a onclick=jq('"+data[i].id+"')>"+data[i].filechuname+"</a></td>";
		        		 } 
		        		 }else{
		        			 a +="<td></td>" 
		        		 }
		        		 a +="</tr>"
		        	 }
		        	  a +="</table>"
		        		 
		         } else{
		        	 a +="暂无处理信息";
		         }
		        	 document.getElementById("chid").innerHTML = a; 
		         }
		    });  
			 
			 $.ajax({  //复查驳回信息
		         url : "${ctx}/recheandrejec/yhcgRecheckandrejec/listbo",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) { 
		        	 var a='';
		        	 if(data.length>0){
		        		$("#bo1").show();
		     			$("#bo2").show();
		        	 a="<table><tr><td>编号</td><td>驳回人</td><td>驳回原因</td><td>驳回日期</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].reviewuser+"</td><td>"+data[i].reviewproposal+""
		        		 +"</td><td>"+data[i].reviewtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		         } else{
		            a+="暂无驳回信息";
		         }
		        	 document.getElementById("boid").innerHTML = a; 
		         }
		    });  
			 $.ajax({  //复查通过信息
		         url : "${ctx}/recheandrejec/yhcgRecheckandrejec/listtong",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a='';
		        	 if(data.length>0){
		        		$("#fu1").show();
		     			$("#fu2").show();
		        	 a="<table><tr><td>编号</td><td>复查人</td><td>复查建议</td><td>复查日期</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].reviewuser+"</td><td>"+data[i].reviewproposal+""
		        		 +"</td><td>"+data[i].reviewtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		        		
		         } else{
		        	a+="暂无复查信息";
		         }
		        	 document.getElementById("tongid").innerHTML = a; 
		         }
		         
		    });  
			 $.ajax({  //结案驳回信息
		         url : "${ctx}/dismissthecase/yhcgDismissthecase/listbo",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a='';
		        	 if(data.length>0){
		        		$("#jiebo1").show();
		     			$("#jiebo2").show();
		        	 a="<table><tr><td>编号</td><td>驳回人</td><td>驳回原因</td><td>驳回日期</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].closeduser+"</td><td>"+data[i].closedproposal+""
		        		 +"</td><td>"+data[i].closedtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		        		
		         } else{
		        	a+="暂无结案驳回信息";
		         }
		        	 document.getElementById("jieidbo").innerHTML = a; 
		         }
		         
		    });  
		})
		
		function jiean(){
			$("#jietid").val($("#id").val());//获取当前工单id
			$('#demoModalguo').modal('show');
		}
		function bohui(){
			$("#jiebid").val($("#id").val());//获取当前工单id
			$('#demoModalbo').modal('show');
		}
		function boqu(){
			$('#demoModalbo').modal('hide');
		}
		
		function tongqu(){
			$('#demoModalguo').modal('hide');
		}
		
		function bobao(){
			if($("#timelimitgai").val()!=null&&$("#timelimitgai").val()!=""&&$("#chuuser2").val()!=null&&$("#chuuser2").val()!=""&&$("#contentchu2").val()!=null&&$("#contentchu2").val()!=""){
				$("#formdatabo").submit();
			}else{
				alert("请输入驳回原因或者驳回人以及驳回时间");
			}
		}
		
		function jiebao(){
			if($("#chuuser1").val()!=null&&$("#chuuser1").val()!=""){//
				$("#formdatatong").submit();
			}else{
				alert("请输入结案人");
			}
			
			
		}
	</script>
	<style type="text/css">
	#cs1,#cs2,#tid1,#tid2,#tid3,#tid4,.input-medium{
	width: 60%
	}
	
	#tid{
	width: 25%
	}
	</style>
</head>
<body>
<div>
	<form:form id="inputForm" modelAttribute="yhcgNumberinfo" action="${ctx}/numberinfo/yhcgNumberinfo/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-striped table-bordered table-condensed">
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【联系人信息】</h4></td></tr>
		<tr><td>
		<div class="control-group">
			<label class="control-label">姓名：</label>
			<div class="controls">
				${yhcgNumberinfo.name}
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">电话：</label>
			<div class="controls">
			${yhcgNumberinfo.phone}
			</div>
		</div>
		</td>
		</tr>
			<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【内容描述】</h4></td></tr>
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">来源：</label>
			<div class="controls">
			${fns:getDictLabel(yhcgNumberinfo.come, 'come_type', '')}
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">事件类别：</label>
			<div class="controls">
			${fns:getDictLabel(yhcgNumberinfo.type, 'type_type', '')}
			</div>
		</div>
		</td>
		
		</tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">附件：</label>
			<div class="controls">
			${yhcgNumberinfo.filename}
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td colspan="4">
			<div class="control-group">
			<label class="control-label">内容：</label>
			<div class="controls">
			${yhcgNumberinfo.content}
			</div>
		</div>
		</td>
		
		<tr>
		<td colspan="4">
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
			${yhcgNumberinfo.remark}
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">登记人：</label>
			<div class="controls">
			${yhcgNumberinfo.registrant}
			</div>
		</div>
	
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">办理人：</label>
			<div class="controls"> 
			${yhcgNumberinfo.administrator}
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">办理期限：</label>
			<div class="controls">
				<fmt:formatDate value="${yhcgNumberinfo.timelimit}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【分流派遣】</h4></td></tr>
		
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">责任单位：</label>
			<div class="controls">
			${yhcgNumberinfo.zenname}
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">督办单位：</label>
			<div class="controls">
			${yhcgNumberinfo.duname}
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【延期信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">延期信息：</label>
			<div class="controls" id="yan">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【处理信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">处理信息：</label>
			<div class="controls" id="chid">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【复查驳回】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">驳回信息：</label>
			<div class="controls" id="boid">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【复查信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">复查信息：</label>
			<div class="controls" id="tongid">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【结案驳回】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">结案驳回：</label>
			<div class="controls" id="jieidbo">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【结案信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">结案信息：</label>
			<div class="controls">
			<font style="color: red">未结案</font>
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【扣分信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">扣分信息：</label>
			<div class="controls">
			<font style="color: red">暂无扣分信息</font>
			</div>
		</div>
		</td>
		</tr>
		</table>
		<div class="form-actions" >
			<input id="btnCancel" class="btn btn-primary" type="button" value="结案" onclick="jiean()"/>
			<input id="btnCancel" class="btn" type="button" value="驳回" onclick="bohui()"/>
		</div>
	</form:form>
	</div>
	<div class="modal fade" id="demoModalguo"  style="width: 600px;height:400px;display: none; ">
        <div class="modal-dialog" >
             <div class="modal-content">
                 <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                      <h4 class="modal-title" id="demoModalLabel">结案分析</h4>
                 </div>
                 <div class="modal-body" style="height: 99%;">
                 <form id="formdatatong" action="${ctx}/numberinfo/yhcgNumberinfo/formnumberjietong" method="post" >
                 <table>
                 	<tr>
                 	<td>
                 	结案人:
                 	</td>
                 	<td colspan="3">
                 	<input type="hidden" id="jietid" name="id">
                 	 <input type="text" name="chuuser" id="chuuser1" placeholder="请输入结案人" class="required">
                 	</td>
                 	</tr>
                	 <tr>
                 	<td>
                 	结案内容:
                 	</td>
                 	<td colspan="3">
                 	 <textarea  id="contentchu1" name="contentchu" placeholder="请输入结案内容"></textarea>
			        </td>
                 	</tr>
                 	<tr>
			        <td>
				    重复投诉:
                 	</td>
                 	<td>
                 	  <select name="fuhestatus">
                 	  <option value="">请选择</option>
                 	  <option value="1">是</option>
                 	  <option value="2">否</option>
                 	  </select>
                 	</td>
                 	<td></td>
                 	</tr>
                 	</table>
                   	 <a onclick="jiebao()"><button type="button" class="btn btn-primary"  >保存</button></a>
                      <button type="button" class="btn " data-dismiss="modal" onclick="tongqu()" >取消</button>
                     </form>
                     </div>
             </div>
         </div>
    </div> 
    <div class="modal fade" id="demoModalbo"  style="width: 600px;height:400px;display: none; ">
        <div class="modal-dialog" >
             <div class="modal-content">
                 <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                      <h4 class="modal-title" id="demoModalLabel">结案分析</h4>
                 </div>
                 <div class="modal-body" style="height: 99%;">
                 <form id="formdatabo" action="${ctx}/numberinfo/yhcgNumberinfo/formnumberjiebo" method="post" >
                 <table>
                 	<tr>
                 	<td>
                 	驳回人:
                 	</td>
                 	<td colspan="3">
                 	<input type="hidden" id="jiebid"  name="id">
                 	 <input type="text" name="chuuser" id="chuuser2" placeholder="请输入驳回人" class="required">
                 	</td>
                 	</tr>
                 	<tr>
                 	<td>
                 	办理期限:
                 	</td>
                 	<td colspan="3">
               		 <input name="timelimitgai" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${yhcgNumberinfo.timelimitgai}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" id="timelimitgai" style="width: 150px"/>
                 	</td>
                 	</tr>
                	 <tr>
                 	<td>
                 	驳回原因:
                 	</td>
                 	<td colspan="3">
                 	 <textarea  id="contentchu2" name="contentchu" placeholder="请输入驳回原因"></textarea>
			        </td>
                 	</tr>
                 	</table>
                  	  <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="bobao()" >保存</button>
                      <button type="button" class="btn" data-dismiss="modal" onclick="boqu()" >取消</button>
                     </form>
                     </div>
             </div>
         </div>
    </div> 
</body>
</html>